<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>会员列表</title>
	<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
	<script language="javascript">
	 $().ready(function(){
		 $("#add").click(function(){
			 window.location.href="<%=basePath%>admin/member/add.shtml";
		 });
	 });
	 </script>
  </head>
  
  <body background='skin/images/allbg.gif'>
	  <form action="<%=basePath%>admin/member/list.shtml" id="form1" name="form1" method="get">
		  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
			  <tr>
			  	<td align="left">
			  		<input type="button" id="add" name="add" value="添加" />
			  	</td>
				<td align="right">
					<select name="field">
						<option value="username" <c:if test="${paramBean.field == 'username'  }">selected</c:if>>手机</option>
						<option value="email" <c:if test="${paramBean.field == 'email'  }">selected</c:if>>E-mail</option>
						<option value="name" <c:if test="${paramBean.field == 'name'  }">selected</c:if>>姓名</option>
					</select>
					<input name="keyword" type="text" id="keyword" value="${paramBean.keyword }" size="20" />
			  		<input type="submit" name="add" value="查询"/>
			  	</td>
			  </tr>
		  </table>
	  </form>
	  <table width="100%" border="0" class="onelineTable" cellpadding="2"
			cellspacing="1" bgcolor="#D1DDAA" align="center">
			<tr align="center" bgcolor="#E7E7E7" height="22">
				<td width="10%">
					手机
				</td>
				<td width="10%">
					E-mail
				</td>
				<td width="10%">
					姓名
				</td>
				<td width="10%">
					状态
				</td>
				<td width="10%">
					最后登录日期
				</td>
				<td width="10%">
					最后登录ip
				</td>
				<td width="10%">
					创建日期
				</td>
				<td width="20%">
					操作
				</td>
			</tr>
			<c:forEach items="${ pagination.recordList}" var="member">
				<tr align='center' bgcolor="#FFFFFF"
						onMouseMove="javascript:this.bgColor='#FCFDEE';"
						onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			  		<td>${member.username}</td>
			  		<td>${member.email}</td>
			  		<td>${member.name}</td>
			  		<td>
			  			<c:choose>
			  				<c:when test="${member.isLocked}">已锁定</c:when>
			  				<c:otherwise>
								<c:choose>
				  				<c:when test="${member.isEnabled}">已启用</c:when>
				  				<c:otherwise>未启用</c:otherwise>
				  				</c:choose>
							</c:otherwise>
			  			</c:choose>
			  		</td>
			  		<td><fmt:formatDate value="${member.loginDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
			  		<td>${member.loginIp}</td>
			  		<td><fmt:formatDate value="${member.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
			  		<td>
				  		<a href="<%=basePath%>admin/member/edit.shtml?id=${member.id}">编辑</a> 
				  		<a href="<%=basePath%>admin/member/view.shtml?id=${member.id}">查看</a>
				  		<a href="<%=basePath%>admin/member/editpassword.shtml?id=${member.id}">修改密码</a>
			  		</td>
			  	</tr>
		  	</c:forEach>
			<tr align="right" bgcolor="#EEF4EA">
				<td height="36" colspan="11" align="center">
					${pagination.pageHtml }
				</td>
			</tr>
	  </table>
  </body>
</html>
